/*
package com.itheima.advice;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.nio.file.AccessDeniedException;

@Component
public class HandlerControllerException implements HandlerExceptionResolver {

    */
/**
     *
     * @param httpServletRequest
     * @param httpServletResponse
     * @param o 出现异常的对象
     * @param e 出现的异常信息
     * @return ModelAndView
     *//*

    @Override
    public ModelAndView resolveException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) {
        ModelAndView mv = new ModelAndView();
        //一般不用
        mv.addObject("errorMessage",e.getMessage());
        if(e instanceof AccessDeniedException){
            mv.setViewName("forward:/403.jsp");
        }else{
            mv.setViewName("forward:/500.jsp");
        }
        return mv;
    }
}
*/
